1. Field of the Invention
The present invention generally relates to parallel processing, and more particularly, to a method and system for enabling managed code-based application program to access graphics processing unit in a computed unified device architecture (CUDA) environment.
2. Description of the Related Art
Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in this application and are not admitted to be prior art by inclusion in this section.
CUDA is a software platform for massively parallel high-performance computing on graphics processing units (GPU). A GPU is a parallel multi-core architecture and each core is capable of running thousands of threads simultaneously. Especially when an application program is designed for this architecture, the GPU can offer substantial performance benefits. CUDA development tools generally work alongside a conventional C/C++ compiler, so that programmers can use a variation of C program language to code algorithms for execution on the GPU. CUDA also hides the GPU architecture beneath application programming interface (API) and, as the result, application programmers are not required to be familiar with the architecture and the low level programming language. Instead, predefined graphics functions in the API can be called. Compiling a CUDA program, however, is not as straightforward as running a C compiler to convert source code into executable object code, partly because the CUDA program targets two different processor (CPU and GPU) architectures and partly because of the hardware abstraction of CUDA.
Although equipped with the conventional C/C++ compiler, the present CUDA environment does not support application programs that are written in a programming language that is for creating managed code to be executed under a virtual machine (such as Virtual Basic .NET). However, for programming convenience and security considerations, more and more applications are written in such a programming language. Moreover, there are also needs to executed a managed code-based application program in the CUDA environment so that the GPU computing resources can be utilized.
Before the managed code-based application program could access the GPU hardware resource, the application program needs to be translated into the corresponding GPU machine codes. However, such machine code translation can be inefficient without any support from the enhanced CUDA environment.
What is needed in the art is thus a method and system that can enable a managed code-based application program to access the resources of a GPU in the CUDA environment and can address at least the foregoing issues.